package com.betterjr.modules.application.dubbo;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.betterjr.common.web.AjaxObject;
import com.betterjr.modules.application.IApplicationCustRoleService;
import com.betterjr.modules.application.service.ApplicationCustRoleService;

@Service(interfaceClass = IApplicationCustRoleService.class)
public class ApplicationCustRoleDubboService implements IApplicationCustRoleService {

    @Autowired
    private ApplicationCustRoleService applicationCustRoleService;

    /**
     * 
     * <p>Overriding Method of webSaveUpdateApplicationCustRole</p>  
     * <p>Description: 保存或者新增应用企业角色表</p> 
     * @param anCustNo 企业编号
     * @param anRoleId 角色id
     * @param anApplicationIds 应用id集合
     * @return 
     * @see com.betterjr.modules.application.IApplicationCustRoleService#webSaveUpdateApplicationCustRole(java.lang.Long, java.lang.Long, java.lang.String) 
     * @author xuyp
     * @date 2017年11月21日 上午10:02:44
     */
    @Override
    public String webSaveUpdateApplicationCustRole(Long anCustNo, Long anRoleId, String anApplicationIds) {

        return AjaxObject
                .newOk("新增成功",
                        applicationCustRoleService.saveUpdateApplicationCustRole(anCustNo, anRoleId, anApplicationIds))
                .toJson();
    }

    /**
     * 
     * <p>Overriding Method of webQueryEffectiveApplicationCustRole</p>  
     * <p>Description: 查询生效的企业角色应用表信息</p> 
     * @param anCustNo  企业编号
     * @param anRoleId  角色id
     * @return 
     * @see com.betterjr.modules.application.IApplicationCustRoleService#webQueryEffectiveApplicationCustRole(java.lang.Long, java.lang.Long) 
     * @author xuyp
     * @date 2017年11月21日 上午10:03:49
     */
    @Override
    public String webQueryEffectiveApplicationCustRole(Long anCustNo, Long anRoleId) {

        return AjaxObject
                .newOk("查询成功", applicationCustRoleService.queryEffectiveApplicationCustRole(anCustNo, anRoleId))
                .toJson();
    }

}
